import mongoose, { Mongoose } from 'mongoose'

const str = 'mongodb://localhost:27017/test'

export function mongoGo(): void {
  mongoose.connection.on('error', (args) => {
    console.log(args)
  })
  mongoose.connect(
    str,
    { useNewUrlParser: true, useUnifiedTopology: true },
    () => console.log('[mongodb] localhost:27017 connect success!!')
  )
}
